<template>
  <div>
    <h2>Child1组件：</h2>
    <div>子组件1的消息：{{ msg }}</div>

    <div>
      <el-button type="primary" @click="handleChangeParentMsg($parent)">修改父组件的msg</el-button>
    </div>
  </div>
</template>
<script setup lang="ts">
defineOptions({
  name: 'Child1',
})

const msg = ref('我是子组件-1的消息')
const handleChangeParentMsg = (parent: any) => {
  parent.msg += '~'
}
defineExpose({
  msg,
})
</script>

<style scoped></style>
